#define _CRT_SECURE_NO_WARNINGS 1
//#include<iostream>
//#include<string>
//using namespace std;
//class person
//{
//public:
//	static int a;
//protected:
//	int _name;
//public:
//	person()
//	{
//		a++;
//	}
//};
//class student:public person
//{
//public:
//	student()
//	{
//		b++;
//	}
//	static int b;
//protected:
//
//	string stuid;
//};
//class graduate :public student
//{
//public:
//	graduate()
//	{
//
//	}
//protected:
//	int abc;
//};
//int person::a = 0;
//int student::b = 0;
//int main()
//{
//	person p1;
//	student s1;
//	graduate g1;
//	cout<<&s1.b<<endl;
//	cout << &g1.b << endl;
//	cout << g1.b << endl;
//
//}
#include <iostream>
#include <iterator>
using namespace std;
#include<string>
#include<vector>
int main() {
    long long int a = 0;
    cin >> a;
    vector<string> s1; int i = 0;
    string s3 = "000";
    while (a)
    {
        if (to_string(a % 1000) == "0")
        {
            s1.push_back(s3);
        }
        else s1.push_back(to_string(a % 1000));
        a /= 1000;
    }
    string s2;
    for (i = 0; i < s1.size(); i++)
    {
        s2 += s1[s1.size() - i - 1];
        if (i != s1.size() - 1)
            s2 += ',';
    }
    cout << s2 << endl;

}